Skip to content

fix: only display hydra:next when the item total is strictly greater …#3967

Merged
dunglas merged 1 commit into
api-platform:2.5from
jeremyteyssedre:fix-show-hydra-next-when-needed
Jan 22, 2021
Merged

fix: only display hydra:next when the item total is strictly greater …#3967
dunglas merged 1 commit into
api-platform:2.5from
jeremyteyssedre:fix-show-hydra-next-when-needed

Conversation

@jeremyteyssedre

Copy link
Copy Markdown
Contributor

…than the number of items per page

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets
License MIT
Doc PR

When the number of items per page is equal to the number of items present in the collection, the page found in the "hydra:next" field will return an empty collection. The "hydra:next" field should therefore only be displayed when the number of items present in the collection is strictly greater than the number of items per page.

@dunglas dunglas merged commit 9cecfab into api-platform:2.5 Jan 22, 2021
@dunglas

dunglas commented Jan 22, 2021

Copy link
Copy Markdown
Member

Good catch, thanks @jeremyteyssedre!

dunglas added a commit that referenced this pull request Jan 22, 2021
* 2.5:
  docs: better formatting in changelog
  Prepare release 2.5.10 (#3970)
  fix: only display hydra:next when the item total is strictly greater than the number of items per page (#3967)
@clementtalleu

Copy link
Copy Markdown
Contributor

When using partial pagination, this modification removes the "hydra:member" node from the api response.

meyerbaptiste added a commit to meyerbaptiste/core that referenced this pull request Feb 2, 2021
…greater than the number of items per page (api-platform#3967)"

This reverts commit 9cecfab.
meyerbaptiste added a commit to meyerbaptiste/core that referenced this pull request Feb 2, 2021
…greater than the number of items per page (api-platform#3967)"

This reverts commit 9cecfab.
meyerbaptiste added a commit to meyerbaptiste/core that referenced this pull request Feb 8, 2021
…greater than the number of items per page (api-platform#3967)"

This reverts commit 9cecfab.
cacahouwete pushed a commit to cacahouwete/core that referenced this pull request Feb 10, 2021
…rty (api-platform#4015)

* Revert "fix: only display hydra:next when the item total is strictly greater than the number of items per page (api-platform#3967)"

This reverts commit 9cecfab.

* Fix partial pagination which no longer returns the "hydra:next" property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants